<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // Object.create()  创建一个对象并为其设置原型
        let obj = {}

        let obj1 = Object.create({
            a: 1,
            b: 2
        })

        let obj2 = Object.create(null) //没有原型的对象

        console.log(obj, obj1, obj2)

        //console.log(obj2.toString()) //直接报错，因为自己和原型都没有这个方法
    </script>
</body>

</html>